import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
//中文语言包
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
//引入面包屑
import MBX from "@/components/BreadClumb/index.vue";

//引入normalize.css重置样式
import "normalize.css";
import "@/assets/public.css";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";

//生成svg sprite图标
import "virtual:svg-icons-register";

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

//全局注册面包屑
//vue3写法app.component(组件名,组件)

app.component("MBX", MBX);

app.use(ElementPlus, {
  locale: zhCn,
});

app.use(createPinia());
app.use(router);

app.mount("#app");
